Array of objects corresponding to link objects (<A HREF=URL>/TT> tags) in source order.
The links array contains an entry for each link object in a document. For example, if a document contains three link objects, these links are reflected as document.links[0], document.links[1], and document.links[2].
To obtain the number of links in a document, use the length property: document.links.length.
A string whose value is the same as the NAME attribute of the object. Note that for button, reset, and submit objects, this is the internal name for the button, not the label that appears onscreen.
Array of objects corresponding to options in a selection object (<OPTION>tags) in source order.
The options array contains an entry for each option in a selection object. For example, if a selection object named musicStyle contains three options, these options are reflected as musicStyle.options[0], musicStyle.options[1], and musicStyle.options[2].
To obtain the number of options in a selection object, use the length property: objectName.options.length.
The self property refers to the current window. Use the self property to disambiguate a window property from a form of the same name. You can also use the self property to make your code more readable.
Applies to
window
Examples
In the following example, self.status is used to set the status property. This usage disambiguate the status property of a window from a form called "status".
<A HREF=""
onClick="this.href=pickRandomURL();"
onMouseOver="self.status='Pick a random URL' ; return true">
For a window, the status property reflects a priority or transient message in the status bar at the bottom of the window, such as the message that appears when a mouseOver event occurs over an anchor. Do not confuse status with defaultStatus. The defaultStatus property reflects the default message displayed in the status bar.
Applies to
window
Examples
Suppose you have created a JavaScript function called pickRandomURL() that lets you select a URL at random. You can use the onClick event handler of an anchor to specify a value for the HREF attribute of the anchor dynamically, and the onMouseOver event handler to specify a custom message for the window in the status property:
<A HREF=""
onClick="this.href=pickRandomURL();"
onMouseOver="self.status='Pick a random URL'; return true">
Go!</A>
In the above example, the status property of the window is assigned to the window's self property, as self.status. As this example shows, you must return true to set the status property in the onMouseOver event handler.
For button, reset, and submit objects, a string that is the same as the VALUE attribute (this is the label that appears onscreen, not the internal name for the button). For checkbox, a string, "on" if item is checked; "off" otherwise. For radioButton, a string, reflection of the VALUE attribute. For selection, reflection of VALUE attribute, sent to server on submit. For text and textArea, string, the contents of the field.
RGB value for color of visited links, expressed as a hexadecimal triplet. This property is the JavaScript reflection of the VLINK attribute of the HTML BODY tag.
The window property refers to the current window. Use the window property to disambiguate a property of the window object from a form of the same name. You can also use the window property to make your code more readable.
Applies to
window
Examples
In the following example, window.status is used to set the status property. This usage disambiguate the status property of a window from a form called "status".
<A HREF=""
onClick="this.href=pickRandomURL();"
onMouseOver="window.status='Pick a random URL' ; return true">